package com.vhall.component.entity.data.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author shimingming
 * @since 2023/6/7 12:31
 */
@Getter
@AllArgsConstructor
public enum DpWatchTimeTopEnum {

    TIME0(0, "00:00-01:00"),
    TIME1(1, "01:00-02:00"),
    TIME2(2, "02:00-03:00"),
    TIME3(3, "03:00-04:00"),
    TIME4(4, "04:00-05:00"),
    TIME5(5, "05:00-06:00"),
    TIME6(6, "06:00-07:00"),
    TIME7(7, "07:00-08:00"),
    TIME8(8, "08:00-09:00"),
    TIME9(9, "09:00-10:00"),
    TIME10(10, "10:00-11:00"),
    TIME11(11, "11:00-12:00"),
    TIME12(12, "12:00-13:00"),
    TIME13(13, "13:00-14:00"),
    TIME14(14, "14:00-15:00"),
    TIME15(15, "15:00-16:00"),
    TIME16(16, "16:00-17:00"),
    TIME17(17, "17:00-18:00"),
    TIME18(18, "18:00-19:00"),
    TIME19(19, "19:00-20:00"),
    TIME20(20, "20:00-21:00"),
    TIME21(21, "21:00-22:00"),
    TIME22(22, "22:00-23:00"),
    TIME23(23, "23:00-00:00"),


    ;
    private final Integer value;

    private final String description;

    public static String getDescription(Integer value) {
        DpWatchTimeTopEnum parse = parse(value);
        if (parse != null) {
            return parse.getDescription();
        }
        return StringUtils.EMPTY;
    }

    public static DpWatchTimeTopEnum parse(Integer value) {
        for (DpWatchTimeTopEnum anEnum : DpWatchTimeTopEnum.values()) {
            if (anEnum.getValue().equals(value)) {
                return anEnum;
            }
        }
        return null;
    }
}
